<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/animation.css">
    <style>
        [v-cloak] {
            display: none;
        }
        
        .con {
            width: 200px;
            height: 200px;
            background: red;
        }
    </style>
</head>

<body>
    <div id="main" v-cloak>
        <h1>{{msg}}</h1>

        <input type="button" value="toggle" @click="flag=!flag">

        <transition enter-active-class="bounceIn" leave-active-class="bounceOut" :duration="1000">
            <div class="con animated" v-if="flag"></div>
        </transition>
    </div>


    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#main',
            data: {
                msg: 'Hello Vue1',
                flag: false
            }
        })
    </script>

</body>

</html>